package com.logos.musicframe.utils;

import com.logos.musicframe.controller.UsersController;
import com.logos.musicframe.resp.UsersResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * @author logos
 * date 2025/6/14 10:23
 * @version v1.0
 * @Package com.logos.musicframe.utils
 */
@Component
public class UserInfoUtil {

    @Autowired
    @Lazy
    private UsersController usersController;

    public UsersResp getUserInfo() {
        return usersController.getCurrentUserInfo().getData();
    }

    public Integer getUserId() {
        return getUserInfo().getId();
    }
}
